import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    token: null,
    userId: null,
    asideVisible: false
  },
  mutations: {
    setToken(state, newToken) {
      state.token = newToken;
    },
    setUserId(state, newUserId) {
      state.userId = newUserId;
    },
    setAsideVisible(state, newState) {
      state.asideVisible = newState;
      console.log('asideVisible = ' + newState);
    }
  },


})
export default store